package org.idea.qiyu.framework.threadpool.async.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author linhao
 * @Date created in 10:17 下午 2021/10/24
 */
@Service
public class ArticleServiceImpl {

    public void doTest(){
        System.out.println("this is do test");
        System.out.println("更新任务线程"+Thread.currentThread().getName());
        System.out.println("this is end");
    }

    @Async("asyncThreadPoolExecutor")
    public void updateCount() {
        System.out.println("========");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("++++++++");
        System.out.println("更新任务线程"+Thread.currentThread().getName());
    }
}
